package server;

import java.util.Date;
import java.util.TimerTask;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class HTMLTimerTask extends TimerTask {
	HTTPClient httpclient;
	public static ExecutorService fixedThreadPool;
	
	HTMLTimerTask(HTTPClient _httpclient) {
		httpclient = _httpclient;
	}
	
	@Override
    public void run() {
        // TODO call the real function
       try {
            System.out.println("Timer :" + (new Date()));
            fixedThreadPool = Executors.newFixedThreadPool(20);
    		//httpclient.run();
            fixedThreadPool.execute(httpclient);
    		/*while(!(HTTPClient.threadNum == 0 && HTTPClient.threadUse == 1))
    		{
    			Thread.sleep(1000);
    		}
    		System.out.println("----------------------------------------------");*/
        } catch (Exception e) {
        	// TODO Auto-generated catch block
            //e.printStackTrace();
        }
    }

}
